/*
 * Copyright (c) 2005, 2014 vacoor
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 */
package org.vacoor.nothing.web.captcha;

import java.awt.image.BufferedImage;

/**

 * @author vacoor
 */
public interface ImageCaptchaService {

    BufferedImage getChallengeFor(String id);

    /**
     * 验证完毕后立即使当前验证码失效
     *
     * @param id
     * @param response
     * @return
     */
    boolean validate(String id, String response);

    /**
     * 验证完毕选择是否立即失效，针对于某些特定需求, 应该尽可能使验证码为一次性
     * @param id
     * @param response
     * @param remove
     * @return
     */
    boolean validate(String id, String response, boolean remove);

}
